package cn.blb.service.edu.service.impl;

import cn.blb.service.edu.mapper.VideoMapper;
import cn.blb.service.edu.entity.Video;
import cn.blb.service.edu.service.VideoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程视频 服务实现类
 * </p>
 *
 * @author yl
 * @since 2022-03-17
 */
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements VideoService {


    @Override
    public boolean saveVideo(Video video) {
        return this.save(video);
    }

    @Override
    public boolean removeBatchByIds(List<Video> list) {
        for (Video video : list) {
            boolean b = this.removeById(video.getId());
            if(!b){
                return false;
            }
        }
        return true;
    }
}
